<?php

use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;

class StationReportsTableSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
    	$timings = DB::table('timings')->get();
    	$stations = DB::table('stations')->get();
    	$records = [];

    	foreach ($stations as $station) {
			foreach ($timings as $timing) {
				$records[] = [
					'company_id' => 1,
					'project_id' => 1,
					'station_id' => $station->id,
					'user_id' => 1,
					'timing_id' => $timing->id,
					'project_name' => '花园城一期',
					'user_name' => 'George',
					'status' => 1,
					'address' => '测试地址-' . $station->id,
					'longitude' => 128.838373,
					'latitude' => 28.838363,
					'created_at' => date('Y-m-d H:i:s'),
					'updated_at' => date('Y-m-d H:i:s')
				];
			}
		}

		DB::table('reports')->insert($records);
    }
}
